package com.iotechn.unimall.admin.api.seckill;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.dto.seckill.SeckillSpuDTO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;

/**
 * 
 *
 * @author hct
 * @email 77802226@qq.com
 * @date 2020-03-21 17:27:09
 */
@HttpOpenApi(group = "admin.seckill", description = "")
public interface AdminSeckillService {

    @HttpMethod(description = "列表", permission = "operation:seckill:query", permissionParentName = "商品管理", permissionName = "秒杀商品")
    public Page<SeckillSpuDTO> list(
            @HttpParam(name = "spuName", type = HttpParamType.COMMON, description = "商品的状态") String spuName,
            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "商品的状态") Integer status,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "id") Long  id) throws ServiceException;

    @HttpMethod(description = "创建", permission = "operation:seckill:create", permissionParentName = "商品管理", permissionName = "秒杀商品")
    public String create(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId,
            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "spuId") Long spuId,
            @NotNull @HttpParam(name = "gmtStart", type = HttpParamType.COMMON, description = "开始时间戳") Long gmtStart,
            @NotNull @HttpParam(name = "gmtEnd", type = HttpParamType.COMMON, description = "结束时间戳") Long gmtEnd,
            @NotNull @HttpParam(name = "seckillSkuList", type = HttpParamType.COMMON, description = "sku链表") List skuList,
            @NotNull @HttpParam(name = "limitCount", type = HttpParamType.COMMON, description = "每人秒杀限制量") Float limitCount,
            @NotNull @HttpParam(name = "spuSeckillPrice", type = HttpParamType.COMMON, description = "商品spu 显示价格") Integer spuSeckillPrice,
             @HttpParam(name = "orderBuyType", type = HttpParamType.COMMON, description = "购买类型 （0 自提 1 派送）",valueDef = "1") Boolean orderBuyType)
            throws ServiceException;


    @HttpMethod(description = "修改", permission = "operation:seckill:update", permissionParentName = "商品管理", permissionName = "秒杀商品")
    public SeckillSpuDTO update(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "团购商品spuID") Long id,
            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "spuId") Long spuId,
            @NotNull @HttpParam(name = "gmtStart", type = HttpParamType.COMMON, description = "开始时间戳") Long gmtStart,
            @NotNull @HttpParam(name = "gmtEnd", type = HttpParamType.COMMON, description = "结束时间戳") Long gmtEnd,
            @NotNull @HttpParam(name = "seckillSkuList", type = HttpParamType.COMMON, description = "sku链表") List skuList,
            @NotNull @HttpParam(name = "limitCount", type = HttpParamType.COMMON, description = "每人秒杀限制量")Float limitCount,
            @NotNull @HttpParam(name = "spuSeckillPrice", type = HttpParamType.COMMON, description = "商品spu 显示价格")Integer spuSeckillPrice,
             @HttpParam(name = "orderBuyType", type = HttpParamType.COMMON, description = "购买类型 （0 自提 1 派送）",valueDef = "false") Boolean orderBuyType) throws ServiceException;



    @HttpMethod(description = "删除", permission = "operation:seckill:delete", permissionParentName = "商品管理", permissionName = "秒杀商品")
    public String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "删除Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "暂停", permission = "operation:seckill:suspend", permissionParentName = "商品管理", permissionName = "秒杀商品")
    public String suspend(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "暂停Id")Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID")Long adminId) throws ServiceException;


    @HttpMethod(description = "启动", permission = "operation:seckill:start", permissionParentName = "商品管理", permissionName = "秒杀商品")
    public String start(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "启动Id")Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID")Long adminId) throws ServiceException;





}

